<%= form_for [kuztuscms, @user], :html => { :class => 'form-horizontal' } do |f| %>
  <% if @user.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>

      <ul>
      <% @user.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  <fieldset>
    <legend>
      <% if @first_user %>
        <%= 'Please create admin user' %>
      <% else %>
        <%= controller.action_name.capitalize %> User
      <% end %>
    </legend>

    <div class="control-group">
      <%= f.label :username, :class => 'control-label' %>
      <div class="controls">
        <%= f.text_field :username, :class => 'text_field' %>
      </div>
    </div>

    <div class="control-group">
      <%= f.label :email, :class => 'control-label' %>
      <div class="controls">
        <%= f.email_field :email, :class => 'text_field' %>
      </div>
    </div>

    <div class="control-group">
      <%= f.label :password, :class => 'control-label' %>
      <div class="controls">
        <%= f.password_field :password, :class => 'text_field' %>
      </div>
    </div>

    <div class="control-group">
      <%= f.label :password_confirmation, :class => 'control-label' %>
      <div class="controls">
        <%= f.password_field :password_confirmation, :class => 'text_field' %>
      </div>
    </div>

    <div class="form-actions">
      <%= f.submit nil, :class => 'btn btn-primary' %>
      <%= link_to 'Cancel', kuztuscms.users_path, :class => 'btn' %>
    </div>
  </fieldset>
<% end %>

